import React, {useEffect, useState, useRef} from 'react'
import {
	Button,
	Space,
	Modal,
	message,
	Tabs,
	Form,
	Row,
	Col,
	Input,
	Select,
	Cascader,
	TreeSelect,
	DatePicker,
} from 'antd'
import {connect, useModel} from 'umi'
import moment from 'moment'
import {ExclamationCircleFilled} from '@ant-design/icons'
import {getAllCitys, getHolderDictInfo} from '@/service/common'
import SearchForm from '@/components/SearchForm'
import CommonTable from '@/pages/carMessage/archives/components/CommonTable'
import {getBusinessCode} from '@/service/carMessage/common'
import {getCompany} from '@/service/system/company'
import {modelSeriesFun, translateDataToTree} from '@/utils/common/index'
import {getXZCarTypeList} from '@/service/carMessage/list'
import Permissions from '@/components/Permissions'
import {downloadDocumentUrl} from '@/service/common/download'
import styles from './index.less'
// api调用
import {
	getNodeList,
	postReceiveCert,
	postReceiveInv,
	postReceivePurchaseTax,
	postBatchPrepareCar,
	importInsurance,
	importInsuranceCheck,
	getInsuranceErrorList,
	importEquipment,
	importEquipmentCheck,
	getEquipmentErrorList,
} from '@/service/carMessage/archives'
import {
	addTarget,
	importCheck,
	importSave,
	getErrorList,
} from '@/service/carMessage/target'

import {
	importLicenceCheck,
	importLicence,
	getLicenceErrorList,
} from '@/service/carMessage/licence'
import {uploadFileUrl} from '@/service/common/upload'
import 'moment/locale/zh-cn'
// 字典
import {licenseProperty, carPStatusOther} from '../dict'
import {twoDecimalPattern, carNoPattern} from '@/utils/common/validator'
import BatchUpload from './components/BatchUpload'
import BatchUploadImg from './components/BatchUploadImg'

const formItemLayout = {
	labelCol: {flex: '100px'},
	wrapperCol: {flex: '1'},
}

const typeList: any = [
	{
		label: '车辆GPS有线（主）',
		value: '12',
	},
	{
		label: '车辆GPS有线（辅）',
		value: '13',
	},
	{
		label: '车辆GPS无线',
		value: '14',
	},
	{
		label: 'obd设备',
		value: '15',
	},
	{
		label: '市政设备',
		value: '16',
	},
	{
		label: 'tbox设备',
		value: '17',
	},
]

type OtherParams = {
	cityName?: string
	cityId?: string
	parentCityId?: string
	holderName?: string
	companyName?: string
}

const archivesDom = (props: {
	user: {orgId: string | number; userName: string; userId: string}
	location: any
}) => {
	const {initialState} = useModel('@@initialState')
	const {fileName} = initialState || {}
	const childRef = useRef<any>(null)
	const [tabsKey, setTabsKey] = useState<string>()
	const [tabsType, setTabsType] = useState<string>()

	const [processId, setProcessId] = useState<string>('')
	const [form] = Form.useForm<any>()

	const [formData, setFormData] = useState<any[]>([])
	const [otherData, setOtherData] = useState<any>()
	const [orgSource, setOrgSource] = useState<any>([])
	const [nodeList, setNodeList] = useState<any>([])
	const [companyId, setCompanyId] = useState<any>(props?.user?.orgId)
	const [citysList, setCitysList] = useState([])
	const [carTypeList, setCarTypeList] = useState<any>([])
	const [checkData, setCheckData] = useState<any>([])
	const [otherParams, setOtherParams] = useState<OtherParams>()

	// 弹窗
	const [modalTitle, setModalTitle] = useState('')
	const [modalOpen, setModalOpen] = useState(false)
	const [modalType, setModalType] = useState<any>()

	// 批量上传指标
	const [isBatchTagrtOpen, setIsBatchTagrtOpen] = useState(false)
	const [fileTagrtObj, setFileTagrtObj] = useState<any>()

	// 批量上传保单
	const [isBatchInsuranceOpen, setIsBatchInsuranceOpen] = useState(false)
	const [fileInsuranceObj, setFileInsuranceObj] = useState<any>()

	// 批量上传设备
	const [isBatchEquipmentOpen, setIsBatchEquipmentOpen] = useState(false)
	const [fileEquipmentObj, setFileEquipmentObj] = useState<any>()

	// 批量上传证照
	const [isBatchLicenceOpen, setIsBatchLicenceOpen] = useState(false)
	const [fileLicenceObj, setFileLicenceObj] = useState<any>()

	// 批量导入保单图片
	const [isImgModalOpen, setisImgModalOpen] = useState(false)
	// 持有方数据
	const [holderDict, setHolderDict] = useState([])
	/** 获取持有方数据 */
	const getHolderDictInfoFun = () => {
		getHolderDictInfo({type: 'holder'}).then((res: any) => {
			if (res?.success) {
				setHolderDict(res?.data)
			}
		})
	}
	/** 获取节点 */
	const nodeListFun = (orgId?: any) => {
		const newCompanyId = orgId || props?.user?.orgId
		setCompanyId(() => newCompanyId)
		getNodeList({orgId: newCompanyId}).then((res: any) => {
			if (res?.success) {
				setNodeList(() => res?.data)
				setProcessId(() => res?.data[0]?.processId)
				childRef?.current?.refushList()
			}
		})
	}

	useEffect(() => {
		nodeListFun()
		getHolderDictInfoFun()
	}, [])
	/** 获取城市列表 */
	const getCitysFun = () => {
		getAllCitys().then((res: any) => {
			if (res?.success) {
				setCitysList(() => res.data)
			}
		})
	}
	useEffect(() => {
		getCitysFun()
	}, [props?.user?.orgId])

	useEffect(() => {
		const k = nodeList[0]?.nodeId?.toString()
		const process = nodeList[0]?.processId?.toString()
		if (processId?.toString() !== process) {
			setTabsKey(() => k)
			const label: any = typeList?.filter(
				(item: any) => item?.label === nodeList[0]?.nodeName,
			)[0]?.value
			setTabsType(() => label)
		}
	}, [companyId, nodeList])

	// 初始化-获取指标编号
	const getTargetCode = () => {
		getBusinessCode({moduleName: 'target'}).then((res: any) => {
			if (res?.success) {
				form.setFieldsValue({licenseNo: res?.data})
			}
		})
	}

	useEffect(() => {
		getCitysFun()
	}, [props?.user?.orgId])

	// 获取品牌车系
	const onCarTypeListFun = () => {
		getXZCarTypeList().then((res: any) => {
			if (res?.success) {
				setCarTypeList(modelSeriesFun(res.data))
			}
		})
	}

	useEffect(() => {
		onCarTypeListFun()
	}, [])

	// 获取组织机构数据
	const onOrgFun = () => {
		getCompany({merchantId: props?.user?.orgId}).then((res: any) => {
			if (res?.success) {
				const list: any = translateDataToTree(res?.data)
				setOrgSource(list as any)
			}
		})
	}

	useEffect(() => {
		onOrgFun()
	}, [props?.user?.orgId])

	// 搜索
	const onFinish = (values: any) => {
		setOtherData(() => values)
		nodeListFun(values?.companyId)
	}
	// 重置
	const onReset = () => {
		setOtherData(() => {})
		nodeListFun(props?.user?.orgId)
	}

	useEffect(() => {
		const formItems: any[] = [
			{
				type: 'group',
				key: 'group1',
				groupItems: [
					{
						type: 'select',
						key: 'fashionId',
						name: 'fashionId',
						label: '品牌车系车型',
						keys: 'id',
						title: 'fullName',
						items: [...carTypeList],
					},
					{
						type: 'input',
						key: 'vin',
						name: 'vin',
						label: '车架号',
					},
					{
						type: 'treeSelect',
						label: '所属公司',
						name: 'companyId',
						key: 'companyId',
						keys: 'id',
						title: 'name',
						defaultValue: companyId,
						treeData: [...orgSource],
					},
				],
			},
			{
				type: 'group',
				key: 'group2',
				groupItems: [
					{
						type: 'select',
						label: '持有方',
						name: 'holderId',
						key: 'holderId',
						keys: 'value',
						title: 'valueName',
						items: [...holderDict],
					},
					{
						type: 'select',
						key: 'carProperty',
						name: 'carProperty',
						label: '车辆性质',
						keys: 'key',
						title: 'label',
						items: [...licenseProperty],
					},
					{
						type: 'input',
						key: 'parkingName',
						name: 'parkingName',
						label: '停车场名称',
					},
				],
			},
		]
		setFormData(formItems)
	}, [orgSource, carTypeList, licenseProperty])

	const onTabsChange = (key: string) => {
		setCheckData(() => [])
		setOtherData(() => {})
		setTabsKey(() => key)
		const keyLabel = nodeList?.filter(
			(item: any) => Number(key) === Number(item?.nodeId),
		)[0]?.nodeName
		const label = typeList?.filter(
			(item: any) => item?.label === keyLabel,
		)[0]?.value
		setTabsType(() => label)
	}

	const restForm = () => {
		setModalOpen(() => false)
		form.resetFields()
	}
	const receiveCertFun = () => {
		// 接收合格证
		postReceiveCert(checkData).then((res: any) => {
			if (res?.success) {
				message.success(res?.msg)
				childRef.current.refushList()
				restForm()
			}
		})
	}

	const receiveInvFun = () => {
		// 接收发票
		postReceiveInv(checkData).then((res: any) => {
			if (res?.success) {
				message.success(res?.msg)
				childRef.current.refushList()
				restForm()
			}
		})
	}

	const receivePurchaseTaxFun = (data: any) => {
		// 缴纳购置税
		postReceivePurchaseTax({carIds: checkData, ...data}).then(
			(res: any) => {
				if (res?.success) {
					message.success(res?.msg)
					childRef.current.refushList()
					restForm()
				}
			},
		)
	}

	const batchPrepareCarFun = () => {
		// 批量备车
		postBatchPrepareCar(checkData).then((res: any) => {
			if (res?.success) {
				message.success(res?.msg)
				childRef.current.refushList()
				restForm()
			}
		})
	}

	const addTargetFun = (data: any) => {
		// 新增指标
		const startTime: string = moment(data?.licenseTime[0]).format(
			'YYYY-MM-DD',
		)
		const endTime: string = moment(data?.licenseTime[0]).format(
			'YYYY-MM-DD',
		)
		addTarget({
			...data,
			licenseStartAndEndTime: `${startTime}~${endTime}`,
			...otherParams,
		}).then((res: any) => {
			if (res?.success) {
				message.success(res?.msg)
				childRef.current.refushList()
				restForm()
			}
		})
	}

	const onSubmit = async () => {
		const formDatas = await form.validateFields()
		if (modalType === 1) {
			receiveCertFun()
		} else if (modalType === 2) {
			receiveInvFun()
		} else if (modalType === 3) {
			receivePurchaseTaxFun(formDatas)
		} else if (modalType === 4) {
			addTargetFun(formDatas)
		} else if (modalType === 16) {
			batchPrepareCarFun()
		}
	}

	// 城市变化
	const onCitysChange = (value: any, selectedOptions: any) => {
		if (value) {
			setOtherParams({
				...otherParams,
				parentCityId: selectedOptions[0].id,
				cityId: selectedOptions[1].id,
				cityName: selectedOptions[1].name,
			})
		}
	}

	// 持有方变化
	const onHolderIdChange = (value: string, key: any) => {
		setOtherParams({
			...otherParams,
			holderName: key?.valueName,
		})
	}

	// 公司变化
	const onCompanyChange = (value: string, option: any) => {
		if (value) {
			setOtherParams({
				...otherParams,
				companyName: option[0],
			})
		}
	}
	// 指标导入
	// 获取指标导入失败表格数据
	const onTagrtTableList = (data: any) =>
		getErrorList({...data}).then((res: any) => {
			if (res?.success) {
				return res
			}
			return {}
		})

	// 指标导入保存
	const importTagrtData = () => {
		const formdata = new FormData()
		formdata.append('file', fileTagrtObj)
		importSave(formdata)
			.then((res: any) => {
				if (res?.success) {
					message.success(res.msg)
					setIsBatchTagrtOpen(() => false)
					childRef.current.refushList()
				}
			})
			.catch((error: any) => {
				message.error(error)
			})
	}
	// 指标错误列表
	const batchTagrtColumns: any = [
		{
			title: '车牌号',
			dataIndex: 'carPlateNo',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车架号',
			dataIndex: 'vin',
			align: 'center',
			width: 260,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '品牌车系车型',
			dataIndex: 'carBrandSeries',
			align: 'center',
			width: 250,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车牌状态',
			dataIndex: 'status',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车牌性质',
			dataIndex: 'licenseProperty',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车牌城市',
			dataIndex: 'cityName',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '指标开始日期',
			dataIndex: 'licenseStartTime',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '指标结束日期',
			dataIndex: 'licenseEndTime',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '持有方',
			dataIndex: 'holderName',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所属公司',
			dataIndex: 'companyName',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所有人',
			dataIndex: 'ownerName',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '错误信息',
			dataIndex: 'errorMsg',
			align: 'center',
			width: 200,
			fixed: 'right',
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]

	// 保单导入
	// 获取保单导入失败表格数据
	const onInsuranceTableList = (data: any) => {
		if (!modalType) {
			message.error('参数错误！')
		}
		let type: number
		if (modalType === 5) {
			type = 18
		} else {
			type = 19
		}

		return getInsuranceErrorList({...data, type}).then((res: any) => {
			if (res?.success) {
				return res
			}
			return {}
		})
	}
	// 保单导入保存
	const importInsuranceData = () => {
		if (!fileInsuranceObj || !processId || !modalType) {
			message.error('参数错误！')
		}
		const formdata = new FormData()
		formdata.append('excel', fileInsuranceObj)
		formdata.append('type', '2')
		formdata.append('processId', processId)
		if (modalType === 5) {
			formdata.append('insuranceType', '1')
		} else {
			formdata.append('insuranceType', '2')
		}
		importInsurance(formdata)
			.then((res: any) => {
				if (res?.success) {
					message.success(res.msg)
					setIsBatchInsuranceOpen(() => false)
					childRef.current.refushList()
				}
			})
			.catch((error: any) => {
				message.error(error.msg)
			})
	}
	// 交强险错误列表
	const batchTrafficColumns: any = [
		{
			title: '车牌号',
			dataIndex: 'carPlateNo',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '品牌车系车型',
			dataIndex: 'carBrandSeries',
			align: 'center',
			width: 250,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所属公司',
			dataIndex: 'companyName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: 'VIN码',
			dataIndex: 'vin',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车辆发动机号',
			dataIndex: 'engineNumber',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '交强险保单号',
			dataIndex: 'compulsoryNo',
			align: 'center',
			width: 200,
			render: (text: string, record: any) => (
				<span>{record?.compulsory?.compulsoryNo || '--'}</span>
			),
		},
		{
			title: '错误信息',
			dataIndex: 'errorMsg',
			align: 'center',
			width: 200,
			fixed: 'right',
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]
	const batchCommercialColumns: any = [
		{
			title: '车牌号',
			dataIndex: 'carPlateNo',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},

		{
			title: '品牌车系车型',
			dataIndex: 'carBrandSeries',
			align: 'center',
			width: 250,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所属公司',
			dataIndex: 'companyName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: 'VIN码',
			dataIndex: 'vin',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '车辆发动机号',
			dataIndex: 'engineNumber',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '商业险保单号',
			dataIndex: 'holderName',
			align: 'center',
			width: 200,
			render: (text: string, record: any) => (
				<span>{record?.commercial?.commercialNo || '--'}</span>
			),
		},
		{
			title: '错误信息',
			dataIndex: 'errorMsg',
			align: 'center',
			width: 200,
			fixed: 'right',
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]
	const resetList = () => {
		childRef.current.refushList()
	}

	// 设备导入
	// 获取设备导入失败表格数据
	const onEquipmentTableList = (data: any) => {
		if (!tabsType) {
			message.error('参数错误！')
		}
		return getEquipmentErrorList({...data, type: tabsType}).then(
			(res: any) => {
				if (res?.success) {
					return res
				}
				return {}
			},
		)
	}
	// 设备导入保存
	const importEquipmentData = () => {
		if (!fileEquipmentObj || !processId || !modalType) {
			message.error('参数错误！')
		}
		const formdata = new FormData()
		formdata.append('file', fileEquipmentObj)
		formdata.append('type', modalType)
		formdata.append('processId', processId)
		importEquipment(formdata)
			.then((res: any) => {
				if (res?.success) {
					message.success(res.msg)
					setIsBatchEquipmentOpen(() => false)
					childRef.current.refushList()
				}
			})
			.catch((error: any) => {
				message.error(error.msg)
			})
	}
	// 设备错误列表
	const batchEquipmentColumns: any = [
		{
			title: 'sim号',
			dataIndex: 'deviceSn',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},

		{
			title: '车架号',
			dataIndex: 'vin',
			align: 'center',
			width: 260,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '安装位置',
			dataIndex: 'installPosition',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '安装时间',
			dataIndex: 'installTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '错误信息',
			dataIndex: 'errorMsg',
			align: 'center',
			width: 200,
			fixed: 'right',
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]
	// 批量导入保单图片取消
	const ImgModalOpen = () => {
		setisImgModalOpen(() => false)
	}

	// 证照导入
	// 获取证照导入失败表格数据
	const onLicenceTableList = (data: any) => {
		if (!modalType) {
			message.error('参数错误！')
		}
		return getLicenceErrorList({...data, type: modalType}).then(
			(res: any) => {
				if (res?.success) {
					return res
				}
				return {}
			},
		)
	}
	// 设备导入保存
	const importLicenceData = () => {
		if (!fileLicenceObj || !processId || !modalType) {
			message.error('参数错误！')
		}
		const formdata = new FormData()
		formdata.append('file', fileLicenceObj)
		formdata.append('processId', processId)
		importLicence(formdata)
			.then((res: any) => {
				if (res?.success) {
					message.success(res.msg)
					setIsBatchLicenceOpen(() => false)
					childRef.current.refushList()
				}
			})
			.catch((error: any) => {
				message.error(error.msg)
			})
	}
	// 证照错误列表
	const batchLicenceColumns: any = [
		{
			title: '车牌号',
			dataIndex: 'carPlateNo',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},

		{
			title: '车架号',
			dataIndex: 'vin',
			align: 'center',
			width: 260,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '品牌车系车型',
			dataIndex: 'carBrandSeries',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '持有方',
			dataIndex: 'holderName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所属公司',
			dataIndex: 'companyName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '城市',
			dataIndex: 'cityName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '所有人',
			dataIndex: 'ownerName',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '行驶证编号',
			dataIndex: 'licenseNo',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '行驶证注册日期',
			dataIndex: 'licenseRegisterTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '行驶证到期日期',
			dataIndex: 'licenseEndTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车运输证号',
			dataIndex: 'carHailingLicNo',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车证有效期',
			dataIndex: 'carHailingRegisterTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车发证日期',
			dataIndex: 'carHailingRegisterTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '运营检日期',
			dataIndex: 'carHailingInspectionTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车证初审申请日期',
			dataIndex: 'carHailingFirstApplyTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车证复审同通过日期',
			dataIndex: 'carHailingSecondApproveTime',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车证所有人',
			dataIndex: 'carHailingOwner',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '网约车证签发机关',
			dataIndex: 'carHailingIssuing',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '是否符合网约车',
			dataIndex: 'compliance',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '机动车登记证',
			dataIndex: 'carMotorStatus',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '主钥匙',
			dataIndex: 'carMainKey',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '副钥匙',
			dataIndex: 'carSecondarKey',
			align: 'center',
			width: 150,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '错误信息',
			dataIndex: 'errorMsg',
			align: 'center',
			width: 200,
			fixed: 'right',
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]

	return (
		<div className={styles.page}>
			<div className="search">
				{formData && (
					<SearchForm
						onFinish={onFinish}
						onReset={onReset}
						formItems={formData}
						formLayout={formItemLayout}
					/>
				)}
			</div>

			<div className={styles.tabs} />
			<Tabs
				type="card"
				activeKey={tabsKey}
				onChange={onTabsChange}
				destroyInactiveTabPane
				items={nodeList?.map(
					(_: {nodeName: string; nodeId: number}) => {
						const id = String(_.nodeId)
						return {
							label: `${_.nodeName}`,
							key: id,
							children: (
								<>
									{_.nodeId === 2 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_certificate">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																if (
																	!checkData?.length
																) {
																	message.error(
																		'请勾选表格数据！',
																	)
																	return false
																}
																setModalTitle(
																	() =>
																		'提示',
																)
																setModalType(
																	() => 1,
																)
																setModalOpen(
																	() => true,
																)
																return true
															}}>
															接收合格证
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_invoice">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																if (
																	!checkData?.length
																) {
																	message.error(
																		'请勾选表格数据！',
																	)
																	return false
																}
																setModalTitle(
																	() =>
																		'提示',
																)
																setModalType(
																	() => 2,
																)
																setModalOpen(
																	() => true,
																)
																return true
															}}>
															接收发票
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_invoiceImport">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'裸车验车入库导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 3 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_tax">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																if (
																	!checkData?.length
																) {
																	message.error(
																		'请勾选表格数据！',
																	)
																	return false
																}
																setModalTitle(
																	() =>
																		'缴纳购置税',
																)
																setModalType(
																	() => 3,
																)
																setModalOpen(
																	() => true,
																)
																return true
															}}>
															缴纳购置税
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_taxImport">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'购置税导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 4 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_addTarget">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalTitle(
																	() =>
																		'新增指标',
																)
																setModalType(
																	() => 4,
																)
																setModalOpen(
																	() => true,
																)
																getTargetCode()
															}}>
															新增指标
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchTarget">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 4,
																)
																setIsBatchTagrtOpen(
																	() => true,
																)
															}}>
															批量上传指标
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_targetExport">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆上牌导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
												<BatchUpload
													isModalOpen={
														isBatchTagrtOpen
													}
													title="批量上传指标"
													setIsModalOpen={
														setIsBatchTagrtOpen
													}
													setFileObj={setFileTagrtObj}
													importData={importTagrtData}
													onTableList={
														onTagrtTableList
													}
													fileNmae="file"
													uploadFileUrl={importCheck}
													columns={batchTagrtColumns}
													sourceId={10}
													templateType="车辆指标管理"
												/>
											</div>
										</>
									) : null}
									{_.nodeId === 5 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_import">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 5,
																)
																setIsBatchInsuranceOpen(
																	() => true,
																)
															}}>
															批量保单导入
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_export">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆交强险导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
												<BatchUpload
													isModalOpen={
														isBatchInsuranceOpen
													}
													title="批量保单导入"
													setIsModalOpen={
														setIsBatchInsuranceOpen
													}
													setFileObj={
														setFileInsuranceObj
													}
													importData={
														importInsuranceData
													}
													onTableList={
														onInsuranceTableList
													}
													fileNmae="excel"
													fileData={{
														type: 1,
														processId,
														insuranceType:
															modalType === 5
																? 1
																: 2,
													}}
													uploadFileUrl={
														importInsuranceCheck
													}
													columns={
														batchTrafficColumns
													}
													sourceId={2}
													templateType="保险导入"
												/>
											</div>
										</>
									) : null}
									{_.nodeId === 6 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_importCommercial">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 6,
																)
																setIsBatchInsuranceOpen(
																	() => true,
																)
															}}>
															批量保单导入
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportCommercial">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆商业险导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
												<BatchUpload
													isModalOpen={
														isBatchInsuranceOpen
													}
													title="批量保单导入"
													setIsModalOpen={
														setIsBatchInsuranceOpen
													}
													setFileObj={
														setFileInsuranceObj
													}
													importData={
														importInsuranceData
													}
													onTableList={
														onInsuranceTableList
													}
													fileNmae="excel"
													fileData={{
														type: 1,
														processId,
														insuranceType:
															modalType === 5
																? 1
																: 2,
													}}
													uploadFileUrl={
														importInsuranceCheck
													}
													columns={
														batchCommercialColumns
													}
													sourceId={2}
													templateType="保险导入"
												/>
											</div>
										</>
									) : null}
									{_.nodeId === 7 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchMain">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 7,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportMain">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆GPS有线（主）导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 8 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchMinor">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 8,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportMinor">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆GPS有线（辅）导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 9 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchWireless">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 9,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportWireless">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'车辆GPS无线导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 10 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchObd">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 10,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportObd">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'obd设备导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 11 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchMunicipal">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 11,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportMunicipal">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'市政设备导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 12 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchTbox">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 12,
																)
																setIsBatchEquipmentOpen(
																	() => true,
																)
															}}>
															批量绑定
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportTbox">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'tbox设备导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{_.nodeId === 13 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchDriving">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalTitle(
																	() =>
																		'批量上传行驶证',
																)
																setModalType(
																	() => 13,
																)
																setisImgModalOpen(
																	() => true,
																)
															}}>
															批量上传行驶证
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchNetwork">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalTitle(
																	() =>
																		'批量上传网约车证',
																)
																setModalType(
																	() => 14,
																)
																setisImgModalOpen(
																	() => true,
																)
															}}>
															批量上传网约车证
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_licenceImport">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																setModalType(
																	() => 15,
																)
																setIsBatchLicenceOpen(
																	() => true,
																)
															}}>
															批量证照导入
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportDriving">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'证照上传导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
												<BatchUploadImg
													title={modalTitle}
													isModalOpen={isImgModalOpen}
													setIsModalOpen={
														ImgModalOpen
													}
													accept={[
														'image/jpeg',
														'image/png',
													]}
													moreNum={50}
													fileNmae={fileName}
													resetList={resetList}
													fileData={{
														modelName: 'LICENCE_FJ',
														targetAttr: 0,
														carPrepareId: processId,
														photoType:
															modalType === 13
																? 2
																: 1,
													}}
													uploadFileUrl={
														uploadFileUrl
													}
												/>
												<BatchUpload
													isModalOpen={
														isBatchLicenceOpen
													}
													title="批量证照导入"
													setIsModalOpen={
														setIsBatchLicenceOpen
													}
													setFileObj={
														setFileLicenceObj
													}
													importData={
														importLicenceData
													}
													onTableList={
														onLicenceTableList
													}
													fileNmae="file"
													fileData={{
														type: modalType,
													}}
													uploadFileUrl={
														importLicenceCheck
													}
													columns={
														batchLicenceColumns
													}
													sourceId={8}
													templateType="证照管理导入模板"
												/>
											</div>
										</>
									) : null}
									{_.nodeId === 14 ? (
										<>
											<div className="btnlist">
												<Space size={12}>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_batchStandby">
														<Button
															type="primary"
															ghost
															size="small"
															onClick={() => {
																if (
																	!checkData?.length
																) {
																	message.error(
																		'请勾选表格数据！',
																	)
																	return false
																}
																setModalTitle(
																	() =>
																		'提示',
																)
																setModalType(
																	() => 16,
																)
																setModalOpen(
																	() => true,
																)
																return true
															}}>
															批量备车
														</Button>
													</Permissions>
													<Permissions permissionID="amc_assetCenter_carMessage_archives_exportStandby">
														<Button
															ghost
															size="small"
															className="btn_warning"
															onClick={() => {
																downloadDocumentUrl(
																	{
																		resourceId:
																			'122',
																		queryDesc:
																			'批量备车导出,resourceId:122',
																		queryParam:
																			{
																				...otherData,
																				processId,
																				type: tabsKey,
																			},
																	},
																)
															}}>
															导出
														</Button>
													</Permissions>
												</Space>
											</div>
										</>
									) : null}
									{[7, 8, 9, 10, 11, 12].includes(
										modalType,
									) ? (
										<>
											<BatchUpload
												isModalOpen={
													isBatchEquipmentOpen
												}
												title="批量绑定"
												setIsModalOpen={
													setIsBatchEquipmentOpen
												}
												setFileObj={setFileEquipmentObj}
												importData={importEquipmentData}
												onTableList={
													onEquipmentTableList
												}
												fileNmae="file"
												fileData={{
													type: modalType,
												}}
												uploadFileUrl={
													importEquipmentCheck
												}
												columns={batchEquipmentColumns}
												sourceId={7}
												templateType="设备导入模板"
											/>
										</>
									) : null}
									{/* {_.nodeId === Number(tabsKey) ? (
										<>
											<CommonTable
												key={_.nodeId}
												search={otherData}
												processId={processId}
												id={_.nodeId}
												type={tabsKey}
												cRef={childRef}
												tableCallback={(data: any) => {
													let ids = data?.map(
														(item: {
															carId: number
														}) => item.carId,
													)
													setCheckData(() => ids)
												}}
											/>
										</>
									) : null} */}
									<>
										<CommonTable
											key={_.nodeId}
											search={otherData}
											processId={processId}
											id="carId"
											companyId={companyId}
											type={tabsKey}
											cRef={childRef}
											tableCallback={(data: any) => {
												const ids = data?.map(
													(item: {carId: number}) =>
														item.carId,
												)
												setCheckData(() => ids)
											}}
										/>
									</>
								</>
							),
						}
					},
				)}
			/>
			<Modal
				open={modalOpen}
				title={modalTitle}
				width={
					modalType === 1 ||
					modalType === 2 ||
					modalType === 3 ||
					modalType === 16
						? 400
						: 800
				}
				footer={
					<>
						<Button
							onClick={() => {
								form.resetFields()
								setModalOpen(() => false)
							}}>
							取消
						</Button>
						<Button type="primary" size="small" onClick={onSubmit}>
							{modalType === 1 || modalType === 2
								? '确定'
								: '保存'}
						</Button>
					</>
				}
				onCancel={() => {
					form.resetFields()
					setModalOpen(() => false)
				}}>
				<>
					<Form
						form={form}
						name="basic"
						layout="horizontal"
						labelCol={{flex: modalType === 8 ? '150px' : '90px'}}
						labelAlign="right"
						labelWrap
						initialValues={{remember: true}}
						autoComplete="off">
						{modalType === 1 ? (
							<div className="modalTip">
								<ExclamationCircleFilled />{' '}
								<span className="title">
									确定所选车辆接收合格证？
								</span>
							</div>
						) : (
							''
						)}
						{modalType === 2 ? (
							<div className="modalTip">
								<ExclamationCircleFilled />{' '}
								<span className="title">
									确定所选车辆接收发票？
								</span>
							</div>
						) : (
							''
						)}
						{/* 缴纳购置税  */}
						{modalType === 3 ? (
							<Row gutter={12}>
								<Col span={24}>
									<Form.Item
										label="购置税"
										name="purchaseTax"
										getValueFromEvent={
											(event: any) =>
												event.target.value.replace(
													/^(-)*(\d+)\.(\d\d).*$/,
													'$1$2.$3',
												) // 只能输入两位小数
										}
										rules={[
											{
												required: true,
												pattern: twoDecimalPattern, // 只能输入数字跟小数点 两位小数
												message:
													'请输入正确的购置税金额',
											},
										]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
							</Row>
						) : (
							''
						)}
						{/* 新增指标  */}
						{modalType === 4 ? (
							<Row gutter={12}>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="指标编号"
										name="licenseNo"
										rules={[
											{
												required: true,
												message: '请输入',
											},
										]}>
										<Input placeholder="请输入" disabled />
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="所属公司"
										name="companyId"
										rules={[
											{
												required: true,
												message: '请选择',
											},
										]}>
										<TreeSelect
											showSearch
											style={{width: '100%'}}
											dropdownStyle={{
												maxHeight: 400,
												overflow: 'auto',
											}}
											placeholder="请选择"
											allowClear
											treeDefaultExpandAll
											fieldNames={{
												label: 'name',
												value: 'id',
											}}
											treeDataSimpleMode
											treeData={[...orgSource]}
											onChange={onCompanyChange}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="所属城市"
										name="cityId"
										rules={[
											{
												required: true,
												message: '请选择',
											},
										]}>
										<Cascader
											fieldNames={{
												label: 'name',
												value: 'id',
												children: 'cityInfoList',
											}}
											options={citysList}
											placeholder="请选择"
											onChange={onCitysChange}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="所有人"
										name="ownerName"
										rules={[
											{
												required: true,
												message: '请输入',
											},
										]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="持有方"
										name="holderId"
										rules={[
											{
												required: true,
												message: '请选择',
											},
										]}>
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'value',
												label: 'valueName',
											}}
											options={[...holderDict]}
											onChange={onHolderIdChange}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="车牌性质"
										name="licenseProperty"
										rules={[
											{
												required: true,
												message: '请选择',
											},
										]}>
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...licenseProperty]}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="车牌状态"
										name="status"
										rules={[
											{
												required: true,
												message: '请选择',
											},
										]}>
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...carPStatusOther]}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label="车牌号"
										name="carPlateNo"
										rules={[
											{
												required: true,
												pattern: carNoPattern,
												message: '请输入正确的车牌号',
											},
										]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} md={{span: 12}}>
									<Form.Item
										label=" 指标日期"
										name="licenseTime"
										rules={[{required: true}]}>
										<DatePicker.RangePicker
											allowClear
											format="YYYY-MM-DD"
											style={{width: '100%'}}
										/>
									</Form.Item>
								</Col>
							</Row>
						) : (
							''
						)}
						{modalType === 16 ? (
							<div className="modalTip">
								<ExclamationCircleFilled />{' '}
								<span className="title">
									确定所选车辆备车？
								</span>
							</div>
						) : (
							''
						)}
					</Form>
				</>
			</Modal>
		</div>
	)
}
export default connect(({user}: any) => ({user}))(archivesDom)
